package com.wjm.blog.core.http;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author yw
 * @Date 2023-05-10
 */
@Component
public class HttpTemplate {

    @Autowired
    private RestTemplateService restTemplateService;

    private static String POST = "POST";

    public String http(String httpMethod, String url, String param) {
        switch (httpMethod) {
            case "POST" :
                return restTemplateService.post(url, param);
            case "GET" :
                return restTemplateService.get(url);
        }
        return null;
    }

}
